<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title>联盟商圈</title>
		<link rel="stylesheet" href="__AGENT__/css/iconfont.css" />
		<link rel="stylesheet" href="__AGENT__/css/css.css" />
		<style>
			.empty {
				top: 123px;
			}
		</style>
	</head>

	<body>
		{include file="public/header" /}
		<div class="index_conbox">
			<div class="index_content clearfix">
				{include file="public/lefter" /}
				<div class="right">
					<div class="rigtop">
						<span class="title">联盟商圈</span>
					</div>
					<div class="indrig_con huodong_con">
						<div class="zizh_btnbox">
							<button class="zizh_btn" onclick="help1()" type="button">帮助说明</button>
						</div>

						<div class="union_xuanxk">
							<div class="zizh_menubox">
								<ul class="clearfix">
									<li class="active" id="two1">
										<a href="{:url('activet/union_circle1')}">已加入</a>
									</li>
									<li id="two2" onclick="">
										<a href="{:url('activet/union_circle2')}">未加入</a>
									</li>
								</ul>
							</div>
							<div class="zizh_conbox">
								<div class="zizh_con_1" id="con_two_1">
									<div class="shxx_item">
										<div class="shxx_row clearfix">
											<div class="left">广告费</div>
											<div class="right">
												<p>
													<em>{$agent_info.ad_money}元</em>
													<a href="javascript:;" onclick="yue_ad()" class="zhongzhi">购买广告费</a>
												</p>
											</div>
											<div class="right">
												<p>
													<em>广告费：{$total_ads}元/客次</em>
												</p>
											</div>
										</div>
									</div>

									<table class="zizh_table1">
										<thead>
											<tr>
												<th>联盟名称</th>
												<th>商圈名称</th>
												<th>联盟主联系方式</th>
												<th>客户量</th>
												<th>状态</th>
												<th>操作</th>
											</tr>
										</thead>
										<tbody id="tbody">
											{volist name="list" id="vo" empty="$empty"}
											<tr>
												<td>{$vo.lm_name}</td>
												<td>{$vo.sq_name}</td>
												<td>{$vo.tel}</td>
												<td>{$vo.customer_volume}</td>
												<td>
													{if $vo.state == 1}
														已通过
													{else}
														审核中
													{/if}
												</td>
												<td>
													<a href="javascript:;" onclick='union_member(" {:url( "activet/union_member",["union_id"=>$vo.union_id])} ")' class="green">成员列表</a>
													<a class="gray" href="javascript:;" onclick="union_tuichu('{$vo.member_id}')">退出联盟</a>
												</td>
											</tr>
											{/volist}
										</tbody>
									</table>
									<div class="fenye" style="display: block;">
										{$list->render()}
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		{include file="public/footer" /}
		<script>
			function union_member(url) {
				layer.open({
					type: 2,
					title: '联盟成员',
					shadeClose: true,
					shade: 0.8,
					area: ['680px', '550px'],
					content: url
				});
			}

			function yue_ad() {
				layer.open({
					type: 2,
					title: '广告购买',
					shadeClose: true,
					shade: 0.8,
					area: ['500px', '300px'],
					content: "{:url('index/yue_ad')}"
				});
			}

			function union_tuichu(id) {
				layer.confirm('您确定要退出吗？', {
					btn: ['确定', '取消'] //按钮
				}, function() {
					$.ajax({
						url: "{:url('activet/union_tuichu')}",
						data: {
							id: id
						},
						success: function(data) {
							if(data.code == 200) {
								layer.msg('退出成功', {
									icon: 1,
									time: 1500 //2秒关闭（如果不配置，默认是3秒）
								}, function() {
									location.href = "{:url('activet/union_circle1')}";
								});
							} else {
								layer.msg('退出失败！');
							}
						}
					})
				})
			};
			//帮助
			function help1() {
				layer.open({
					type: 2,
					title: '鼓励金使用帮助',
					shadeClose: true,
					shade: 0.8,
					area: ['600px', '420px'],
					content: "{:url('activet/help1')}"
				});
			}
		</script>
	</body>

</html>